/*
 * scheduler.h
 *
 *  Created on: May 27, 2013
 *      Author: Aden
 */

#include "pcb.h"

#define TIMER_INTERRUPT 		0
#define IO_INTERRUPT 			1
#define KEYBOARD_IO_INTERRUPT 	2

#define ROUND_ROBIN             3
#define PRIORITY                4
#define FCFS                    5
#define SJ                      6

#ifndef SCHEDULER_H_
#define SCHEDULER_H_

typedef struct scheduler{
	PCBPtr pcb;
	int io_request;
	int time_slice;
	int interrupt;

	//Member functions
	int(*setSchReadyQueue)(struct scheduler *,PCBPtr);
	PCBPtr (*getSchReadyQueue)(struct scheduler *);
	int(*setJobQueue)(struct scheduler *, int);
	PCBPtr *(*getJobQueue)(struct scheduler *, PCBPtr);
	int(*setSchIOQueue)(struct scheduler *, PCBPtr);
	PCBPtr (*getSchIOQueue)(struct scheduler *);
	int(*setContextSwitch)(struct scheduler *,int, PCBPtr process, int);
	PCBPtr (*getContextSwitch)(struct scheduler *);
    PCBPtr (*dispatcher)(struct scheduler *);

}SchedulerStr;

typedef SchedulerStr * SchedulerPtr;

SchedulerPtr newSchedulerConstructor(void);

int setJobQueue(SchedulerPtr this, int queue);
PCBPtr getJobQueue(SchedulerPtr this);
int setSchReadyQueue(SchedulerPtr this, PCBPtr process);
PCBPtr getSchReadyQueue(SchedulerPtr this);
int setSchIOQueue(SchedulerPtr this, PCBPtr process);
PCBPtr getSchIOQueue(SchedulerPtr this);
int setContextSwitch(SchedulerPtr this,int interrupt, PCBPtr process);
PCBPtr getContextSwitch(SchedulerPtr this,PCBPtr process);
PCBPtr dispatcher(SchedulerPtr this);

#endif /* SCHEDULER_H_ */
